<template>
    <div class="successLogin">
        <div class="success">
            <img class="w-24 " src="@/assets/ok.png" alt="">
            <span>登录成功！</span>
        </div>
        <el-button type="danger" size="large" class="ok" @click="onOk"> 我知道了 </el-button>
    </div>
</template>

<script lang="ts" setup>
const onOk = () => {
    var ua = navigator.userAgent.toLowerCase()
    if (ua.match(/MicroMessenger/i) == "micromessenger") {
        WeixinJSBridge.invoke('closeWindow', {}, function (res) {
            if (res.err_msg == 'close_window:ok') {
                console.log('成功')
            } else {
                console.log('失败')
            }
        })
    }
}

</script>

<style lang="scss">
.successLogin {
    text-align: center;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;

    .success {
        margin-top: 50%;

        img {
            margin: auto;
        }
    }

    .ok {
        margin-top: 30%;
    }
}
</style>